﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsTheme.Helper
{
    class FileSelect
    {/// <summary>
    /// 选择单个文件的辅助分类，并且返回单个文件的位置。如果没有选择就关闭了，则返回“”
    /// </summary>
    /// <param name="Filter"></param>
    /// <returns></returns>
        public static String SelectSingle(String Filter) {
            
            using (OpenFileDialog ThemeDialog = new OpenFileDialog())
            {
                ThemeDialog.Title = "请选择文件夹";
                ThemeDialog.Filter = Filter;
                if (ThemeDialog.ShowDialog() == DialogResult.OK)
                {
                    return ThemeDialog.FileName;
                }
                ThemeDialog.Dispose();
                return "";

            }
         
          
        }
    }
}
